package com.byit.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.byit.domain.AppMail;
import com.byit.domain.AppNews;
import com.byit.mapper.AppMailMapper;
import com.byit.mapper.AppNewsMapper;
import com.byit.service.IAppMailService;
import com.byit.service.IAppNewsService;
import com.byit.utils.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @ClassName AppMailServiceImpl
 * @Description TODO
 * @Author lxp
 * @Date 2019-01-22 9:33
 **/
@Service
public class AppMailServiceImpl extends ServiceImpl<AppMailMapper, AppMail> implements IAppMailService {

    @Autowired
    private AppMailMapper appMailMapper;

    @Override
    public Page<JSONObject> selectAppMailPageList(Page<AppMail> pageInfo, Map<String, Object> params) {

        List<JSONObject> list = appMailMapper.selectAppMailPageList(pageInfo, params);

        Page<JSONObject> page = PageUtil.transform(pageInfo);

        page.setRecords(list);

        return page;
    }

    @Override
    public void deleteAppMailById(Map<String, Object> params) {

        appMailMapper.deleteAppMailById(params);
    }
}
